var cell = require('./cell.config');

module.exports = function (g, location, render, config) {
    // 先设置样式

    // 然后绘制
    render.forEach(function (array, row) {
        if (Array.isArray(array)) {
            array.forEach(function (value, col) {
                // 这里value只能是 0 || 1
                if (value) {
                    g.rect(col * cell.width + location.x * cell.width, row * cell.height + location.y * cell.height, cell.width, cell.height);
                    g.fill();
                    // g.stroke();
                }
            });
        } else {
            console.log('ooo');
        }
    });
}